package com.trxy.service.impl;

import com.trxy.mapper.UserMapper;
import com.trxy.model.User;
import com.trxy.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;

    @Override
    public List<User> selectAll(String nameAdmin) {
        return userMapper.selectAll(nameAdmin);
    }

    @Override
    public User userState(int id) {
        return userMapper.userState(id);
    }

    @Override
    public void updateState(String state, int id) {
        userMapper.updateState(state, id);
    }

    @Override
    public User selectByNameAndPassword(String name, String password) {
        return userMapper.selectByNameAndPassword(name, password);
    }

    @Override
    public User selectByName(String name) {
        return userMapper.selectByName(name);
    }
}
